package interfaces;

import java.util.ArrayList;

import lib.Location;


/**
 * This interface defines all the possible methods that a world
 * provides. The world is a n x n grid.
 * 
 * @version 1.0
 */
public interface World {
	
	/**
	 * The method to get a Cell from a location in the world 
	 * @param loc the Location to get the Cell
	 * @return The Cell at the location specified by loc
	 */
	public Cell getCell( Location loc);
	
	/**
	 * Returns the current dimensions of the world
	 */
	public int getDimension();
	
	/**
	 * Return false if the world is a 1D world 
	 * @return true if the world is 2D 
	 *   false if the world is 1D
	 */
	public boolean is2D();
	
	/**
	 * Sets a given Cell at a given Location
	 * @param cell a given cell
	 * @param loc the location that the cell will be placed
	 */
	public void setCell(Cell cell, Location loc);
	
	/**
	 * Sets a given Cell at a all locations 
	 * @param cell a given cell
	 */
	public void setAllCells(Cell cell);
	
	/**
	 * Sets a given Cell at an array of given Locations
	 * @param cell a given cell
	 * @param locs the array of locations that the cell will be placed
	 */
	public void setCellsFromArrayList(ArrayList<Location> locs, Cell cell);
	
	/**
	 * Change all the Cells in the world by calling the transform method in
	 * each Cell in the world
	 */
	public void run();
	
	/**
	 * Bind a Display to a Cell name
	 * @param s The name of a type of Cell
	 * @param d The Display need to bind to the Cell
	 */
	public void put(String s, Display d);
	/**
	 * Get the Display that binded to a type of Cell
	 * @param s The name of a type of Cell
	 * @return The Display that binded to the type of Cell
	 */
    public Display get(String s);	
	
}
